package com.chen.facemanager.controller;

import com.chen.facemanager.bean.WxOrder;
import com.chen.facemanager.dao.WxOrderDao;
import com.chen.facemanager.service.ApkService;
import com.chen.facemanager.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName WxOrderController
 * @Description
 * @Author Mr-CHEN
 * @Date 2019/9/2 0002 18:09
 * @Version V1.0
 **/
@Api(value="/order", tags="订单模块")
@RestController
@RequestMapping("/order")
public class WxOrderController {

    @Autowired
    private WxOrderDao wxOrderDao;

    @ApiOperation(value = "查询订单信息",notes = "查询订单信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wx_no", value = "wx_no", required = true, dataType = "String"),
    })
    @PostMapping("/getOrderByWxNO")
    public Result getOrderByWxNO(String wx_no){
        WxOrder wxOrder = wxOrderDao.findOrder(wx_no);
        if (wxOrder != null){
            return new Result(200,"ok",wxOrder);
        } else {
            return new Result(400,"error","失败");
        }
    }
}